package com.zzzy.util;

import java.util.Timer;
import java.util.TimerTask;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;

import org.apache.log4j.Logger;
import org.springframework.stereotype.Component;


@Component
public class OrderSchedule2 {
	Logger logger = Logger.getLogger(this.getClass());
	
	private int count = 0;
	
	public OrderSchedule2() {
		Runnable runnable = new Runnable() {
			@Override
			public void run() {
				logger.debug( " Do OrderSchedule2 Count: " + count++);
				
			}
		};
		
		ScheduledExecutorService service = Executors.newSingleThreadScheduledExecutor();
		service.scheduleAtFixedRate(runnable, 0, 10, TimeUnit.SECONDS);
		
	}


	
}
